home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15655 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What is wrong with this loop?
  5. Date: 20 Apr 1996 15:47 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <20APR199615472160@erich.triumf.ca>
  9. References: <4l86la$1t9@uwm.edu> <4l8apa$kv8@spanky.pls.ov.com> <4lb6sj$c5c@abel.cc.sunysb.edu>
  10. NNTP-Posting-Host: ftp.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4lb6sj$c5c@abel.cc.sunysb.edu>, dkat@psych1.psy.sunysb.edu (DK) writes...
  14. >/* I assume you mean 
  15. >  while (cd != 'm' || cd != 'f' || cd != 'o')
  16. >/*try using gets(line) - it is always safer*/
  17.  
  18. No - it's always more dangerous - use fgets()
  19.  
  20. >while(gets(line)!=NULL)
  21.  
  22. while(fgets(line, sizeof(line), stdin); /* or replace sizeof(line) with the  */
  23.             /*  actual size    */
  24.  
  25.  
  26. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  27. Internet: bennett@triumf.ca         | of one another only when one can be
  28. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  29. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  30. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  31. or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
  32. or: http:://vancouver-webpages.com/peter/index.html
  33.  
  34.